{% extends "registrar/base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %}教务管理系统 --管理员删除学生{% endblock %}

{% block page_content %}
    <div class="page-header">
        <h1 align="center">删除学生</h1>
    </div>
    <div class="col-md-4 col-md-offset-4">
        <form class="form" id="delete_student_form" action="{{ url_for('rgs.registrar_delete_student') }}"
              method="POST">
            {{ form.hidden_tag() }}
            <div>{{ form.student_id.label }}</div>
            <div>{{ form.student_id }}</div>
            {{ form.submit(hidden='true', id='form_submit') }}
            <br>
            <div>
                <button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">
                    删除
                </button>
            </div>
        </form>
    </div>
    <!--MODAL-->
    <div class="modal fade" role="dialog" id="myModal">
        <div class="modal-dialog">

            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">提示</h4>
                </div>
                <div class="modal-body">
                    <p>您将删除这名学生，确定要继续吗？</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-danger" id="modal-confirm" onclick="confirm()">确定</button>
                </div>
            </div>
        </div>
    </div>

    <script>
        function confirm() {
            document.getElementById("form_submit").click()
        }
    </script>
{% endblock %}